<!DOCTYPE html>
<html>

	<head>
		<title>评论消息</title>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<link rel="stylesheet" href="../js/bootstrap/css/bootstrap.css">
		<script src="/js/jquery/jquery.min.js"></script>
		<script src="../js/bootstrap/js/bootstrap.js"></script>
		<link rel="stylesheet" href="/css/font/css/font-awesome.min.css" />
		<link rel="stylesheet" href="/css/reset.css" />
		<link rel="stylesheet" href="/css/message.css" />
		<script src="/js/plugins/jrender/jrender.js"></script>

	</head>
<script>
	$(function () {
	    //获取当前用户id
        //从本地session中取出缓存的对象
        var user = JSON.parse(sessionStorage.getItem("user"));
        console.log(user.id);
        //发送get请求查询游记评论数据
		$.get("/reviews/user",{authorId:user.id,state:1},function (data) {
            console.log(data);
            //渲染到界面中
			$("#travel").renderValues({list:data});
        });
        //发送get请求查询评论评论数据
		$.get("/reviews/user",{authorId:user.id,state:2},function (data) {
            console.log(data);
            //渲染到界面中
			$("#comment").renderValues({list:data});
        });
    })
</script>
	<body>
		<div class="search-head">
			<div class="row nav-search">
				<div class="col">
					<a href="javascript:history.go(-1);">
						<span><i class="fa fa-chevron-left" ></i></span>
					</a>
				</div>
				<div class="col">
					<span>评论消息</span>
				</div>
				<div class="col deleteAll"></div>
			</div>
		</div>
		<!--当前系统消息-->
		<div id="travel" style=" border:1px solid #cceff5;background:#fafcfd">
			<div class="container systemMsg" render-loop="list">
				<dl class="itemList">
					<dd>
						<img class="rounded-circle head-img" render-src="list.user.headImgUrl" width="20" style="float:left;">
						<span render-html="list.user.nickName"></span>
						<span render-html="list.createTime"></span>
						<p >对我的游记:</p>
						<span render-html="list.title"></span>评论了:
						<span render-html="list.review"></span>
					</dd>
				</dl>
			</div>
		</div>
		<div id="comment" style=" border:1px solid #cceff5;background:#fafcfd">
			<div class="container systemMsg" render-loop="list">
				<dl class="itemList">
					<dd>
						<span render-html="list.nickName"></span>
						<span render-html="list.createTime"></span>
						<p >对我的点评:</p>
						<span render-html="list.title"></span>评论了:
						<span render-html="list.review"></span>
					</dd>
				</dl>
			</div>
		</div>

	</body>

</html>